STEP 6: Let's have the player sprite say the user's choice!

  • Go to . Drag out Say and drop it UNINDENTED after your third if-statement.
  • Change the variable name in front of .say() from sprite to player.
  • Change the string in .say() to "I choose " + choice. (Make sure there is a space after choose!)

We are using string concatenation to combine the string "I choose " with the variable storing the user input.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)